package test.br.com.lh.urabuilder.util
{
	import br.com.lh.urabuilder.model.UraModelLocator;
	import br.com.lh.urabuilder.util.PointHolder;
	
	import flash.geom.Point;
	
	import flexunit.framework.TestCase;
	import flexunit.framework.TestSuite;
	
	import mx.containers.Canvas;
	import mx.controls.Image;

	public class PointHolderTest extends TestCase
	{
		public function PointHolderTest(methodName:String=null)
		{
			super(methodName);
		}
		
		public static function suite():TestSuite{
			var ts:TestSuite = new TestSuite();
			ts.addTest(new PointHolderTest("topPointOK"));
			return ts;
		}
		
		public function topPointOK():void{
			UraModelLocator.modelLocator = null;
			var canvas:Canvas = new Canvas();
			canvas.x = 30;
			canvas.y = 30;
			UraModelLocator.getInstance(canvas);
			var img:Image = new Image();
			img.x = 100;
			img.y =100;
			img.width =10;
			img.height =10; 
			canvas.addChild(img);
			var pointHolder:PointHolder = new PointHolder(img);
			var point:Point = pointHolder.topPoint;
			assertEquals(100,point.y);
			assertEquals(105,point.x);
		}
		
		
	}
}